
function comments(info,exts,isclose){
	if (!info || !jslang.comments){
		return false
	}
	var commenteid = 'comments' + info;
	if (!$(commenteid)){
		alert('Template Error:' + "\n\n" + 'Can not load undefined element: ' + commentid);
		return false;
	}
	if (isclose){
		$(commenteid).style.display = 'none';
		return false
	}else if($(commenteid).style.display == 'none'){
		$(commenteid).style.display = '';
	}
	var exts = exts ? '&amp;' + exts : '';
	var urls = 'display&amp;option=resume&amp;extent=comments&amp;info=' + info + exts;
	if ($(commenteid).innerHTML == ''){
		$(commenteid).innerHTML = '<img src="' + Ajax_prefix + 'images/icon/loading.gif" alt="Loading..." />';
	}
	Ajax.xml(urls,commenteid);
}

function valicomments(results,fname,info){
	if (fname){
		var theform = eval('document.' + fname);
	}else if(document.wane_comments){
		var theform = document.wane_comments;
	}else{
		var theform = false;
	}
	if (results){
		var altmsg = '';
		var extjav = '';
		switch (results){
			case 'uk' : altmsg = jslang.comments_unknown;	extjav = 'c';				break;
			case 'dd' : altmsg = jslang.comments_denied;								break;
			case 'ut' : altmsg = jslang.comments_nomessage;	extjav = 'message';			break;
			case 'ic' : altmsg = jslang.certified;			extjav = 'certifycodeid';	break;
			case 'ss' : altmsg = jslang.comments_success;	extjav = 's';				break;
		}
		if (altmsg != ''){
			alert(altmsg);
		}
		if (extjav == 'c'){
			comments(info,'',true);
		}else if (extjav == 's'){
			comments(info,fname);
		}else if (extjav != '' && theform){
			eval('theform.' + extjav + '.focus()');
			if (theform.Submit.disabled){
				theform.Submit.disabled = false;
			}
		}
	}else{
		if (theform && theform.message.value == ''){
			valicomments('ut',fname);
			return false
		}else if (jslang.comments_certid && theform && theform.certifycodeid.value == ''){
			valicomments('ic',fname);
			return false;
		}else if (confirm(jslang.comments_confirm)){
			if (theform){
				theform.Submit.disabled = true;
			}
		}else{
			return false;
		}
	}
}


function valiresume(results){
	resumequery(true);
	if (results){
		var altmsg = '';
		var extjav = '';
		switch (results){
			case 'ul' 	: altmsg = jslang.unlogined; 				extjav = 'r';	break;
			case 'uc' 	: altmsg = jslang.unchecked;								break;
			case 'ip'	: altmsg = jslang.resumer_repeat;			extjav = 'r';	break;
			case 'mx'	: altmsg = jslang.resumer_maxium;							break;
			case 'arir'	: altmsg = jslang.resumer_adder_invalid;					break;
			case 'arss'	: altmsg = jslang.resumer_adder_success;	extjav = 'r';	break;
			case 'brir'	: altmsg = jslang.resumer_buyer_invalid;					break;
			case 'brex'	: altmsg = jslang.resumer_buyer_expire;					break;
			case 'brss'	: altmsg = jslang.resumer_buyer_success;	extjav = 'r';	break;
			case 'fs'	: altmsg = jslang.resumer_facer_success;	extjav = 'r';	break;
			case 'ff'	: altmsg = jslang.resumer_facer_fail;						break;
			case 'fr'	: altmsg = jslang.resumer_facer_repeat;						break;
		}
		if (altmsg != ''){
			alert(altmsg);
		}
		if (extjav == 'r' && jslang.resumer_address){
			redirect(jslang.resumer_address);
		}
	}else{
		alert(jslang.resumer_notfound);
	}
}

function resumequery(isc){
	var querye = 'querymsg';
	if (!$(querye)){
		return false;
	}
	if (isc){
		$(querye).style.display = 'none';
	}else if ($(querye).style.display == 'none'){
		$(querye).style.display = '';
	}
}
function adder_resume(info){
	if (confirm(jslang.resumer_adder_confirm)){
		resumequery();
		var urls = 'display&amp;option=resume&amp;extent=adder&amp;operate=resume&amp;info=' + info;
		Ajax.xml(urls);
	}
}
function adder_request(info,rid){
	if (confirm(jslang.resumer_adder_confirm)){
		resumequery();
		var urls = 'display&amp;option=resume&amp;extent=adder&amp;operate=request&amp;info=' + info + '&amp;rid=' + rid;
		Ajax.xml(urls);
	}
}
function buyer_resume(info){
	if (confirm(jslang.resumer_buyer_confirm)){
		resumequery();
		var urls = 'display&amp;option=resume&amp;extent=buyer&amp;operate=resume&amp;info=' + info;
		Ajax.xml(urls);
	}
}
function buyer_request(info,rid){
	if (confirm(jslang.resumer_buyer_confirm)){
		resumequery();
		var urls = 'display&amp;option=resume&amp;extent=buyer&amp;operate=request&amp;info=' + info + '&amp;rid=' + rid;
		Ajax.xml(urls);
	}
}
function facer_resume(info){
	if (confirm(jslang.resumer_facer_confirm)){
		resumequery();
		var urls = 'display&amp;option=resume&amp;extent=facer&amp;info=' + info;
		Ajax.xml(urls);
	}
}
function showResumeStatus(isclose){
	if(isclose==1){
		document.getElementById('statusdiv').style.display='none';
		return ;
	}
	if(document.getElementById('statusdiv').style.display=='none'){
		document.getElementById('statusdiv').style.display='';
	}
	else{
		document.getElementById('statusdiv').style.display='none';
	}
	document.getElementById('statusdiv').style.zIndex=10;
}

function changeResumeStatus(str){
	document.getElementById('statusspan').innerHTML='<strong>组别:</strong> <img src="/images/default/company/redo.gif" border=0 align="absmiddle"> <a href="#" title="点击更改简历组别" onclick="showResumeStatus();">'+str+'</a>';
	document.getElementById('statusdiv').style.display='none';
}
